import os
import pandas as pd
from langchain_community.llms import Ollama
from pandasai import Agent
from pandasai import SmartDataframe
from pandasai import SmartDataframe


with open("modelname.cfg","r") as f:
    modelname=f.readline().strip()
print("using llm modle",modelname)

data = pd.read_csv("files/kcjlczycsv.csv")
print(data.head())

llm = Ollama(model=modelname)
df = SmartDataframe(data, config={"llm": llm})
result=df.chat('陈知远学习内容')
print(result)
print("bye")